@clevertask/scribe 0.0.9 → 0.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/README.md +23 -0
  2. package/dist/browser-BJWkU9cc.js +2106 -0
  3. package/dist/clsx-OuTLNxxd.js +16 -0
  4. package/dist/components/Menu/BarMenu.d.ts +1 -0
  5. package/dist/components/Menu/BarMenu.js +38 -36
  6. package/dist/components/Menu/BubbleMenu.js +1 -1
  7. package/dist/components/Scribe/extension/emoji/EmojiList.d.ts +1 -0
  8. package/dist/components/Scribe/extension/emoji/EmojiList.js +35 -0
  9. package/dist/components/Scribe/extension/emoji/suggest.d.ts +16 -0
  10. package/dist/components/Scribe/extension/emoji/suggest.js +40 -0
  11. package/dist/components/Scribe/extension/extension-link.js +208 -200
  12. package/dist/components/Scribe/extension/extension-selectedText.js +1 -1
  13. package/dist/components/Scribe/extension/index.js +30 -24
  14. package/dist/components/Scribe/extension/math-extension.js +1 -1
  15. package/dist/components/Scribe/extension/slashCommand/SlashCommandList.js +7 -5
  16. package/dist/components/Scribe/extension/slashCommand/index.js +4 -153
  17. package/dist/components/Scribe/extension/slashCommand/renderItems.d.ts +1 -1
  18. package/dist/components/Scribe/extension/slashCommand/renderItems.js +14 -14
  19. package/dist/components/Scribe/index.d.ts +1 -0
  20. package/dist/components/Scribe/index.js +69 -75
  21. package/dist/index-BqFHWqw6.js +156 -0
  22. package/dist/{index-C3_lI_rP.js → index-C_aWB8qt.js} +449 -427
  23. package/dist/index-CasgquAq.js +39381 -0
  24. package/dist/{index-Gm-3o3nq.js → index-DeZ8laak.js} +1124 -1083
  25. package/dist/main.css +95 -5
  26. package/dist/{turndown.browser.es-BSoGafvq.js → turndown.browser.es-C1wFFc_i.js} +342 -334
  27. package/dist/utils/create-scribe-editor.js +2 -2
  28. package/dist/utils/html-to-markdown.js +1 -1
  29. package/dist/utils/markdown-to-html.js +1 -1
  30. package/package.json +33 -31
  31. package/dist/browser-DEobZXxB.js +0 -2099
  32. package/dist/index-NRgJVTH-.js +0 -7576
package/README.md CHANGED
@@ -68,6 +68,28 @@ function App() {
68
68
  }
69
69
  ```
70
70
 
71
+ ### With Dark Mode
72
+
73
+ ```tsx
74
+ import "@clevertask/scribe/dist/main.css";
75
+ import { Scribe, ScribeOnChangeContents } from "@clevertask/scribe";
76
+
77
+ function App() {
78
+ const editor = useRef<ScribeRef>(null);
79
+
80
+ const resetContent = useCallback(() => {
81
+ editor.current.resetContent();
82
+ }, []);
83
+
84
+ return (
85
+ <>
86
+ <Scribe darkMode />
87
+ <button onClick={resetContent}>Reset content</button>
88
+ </>
89
+ );
90
+ }
91
+ ```
92
+
71
93
  ## Props
72
94
 
73
95
  | Prop | Type | Default | Description |
@@ -85,6 +107,7 @@ function App() {
85
107
  | `mainContainerStyle` | `React.CSSProperties` | `undefined` | You can send a CSS object to style the main editor container |
86
108
  | `mainContainerClassName` | `string` | `undefined` | The same idea of `mainContainerStyle` but with classes. |
87
109
  | `onKeyDown` | `KeyboardEventHandler` | `undefined` | A callback function that is triggered when a key is pressed within the editor. This allows you to handle custom keyboard shortcuts. For example, you can use this prop to implement a "send message" functionality when `Ctrl + Enter` is pressed. |
110
+ | `darkMode` | `boolean` | `false` | You can switch the darkMode value to change the text editor's theme |
88
111
 
89
112
  ## Helper Functions
90
113